https://leetcode.cn/problems/ant-on-the-boundary/submissions/500400420/


class Solution {
public:
    int returnToBoundaryCount(vector<int>& nums) {

        int sum = 0, cnt = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            sum += nums[i];

            if (sum == 0)
                cnt++;
        }
        // sum += nums[i];

        return cnt;
    }
};